<!DOCTYPE html>
  <html>
  <head>
      <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
      <meta name="description" content="">
      <meta name="author" content="李一丰">
      <title>有请下一位幸运儿2.4</title>
      <!-- 这里是css部分 -->
      <style>
	*{
	margin:0px;
	padding:0px;
	}
	html,body{
	width:100%;
	height:100%;
	margin:auto;
	}
	body{
		background: url(img1.jpg) repeat 100px 100px;	
	}
         #bg {
             width:800px;
             height: 800px;
             margin: 0 auto;
             position: relative;
         }
 
         img[src^="cj.png"] {
             position: absolute;
             z-index: 10;
             top: 230px;
             left: 322px;
         }
 
         #c1{
	     width:600px;
	     height:600px;
             position: absolute;
             z-index: 5;
             top: 60px;
             left: 116px;
             transition: all 20s;
         }
     </style>
 </head>
 <body>
     <!-- 这里是HTML结构部分 --> 
     <div id="bg"><img src="cj.png" alt="pointer"><img id="c1" src="lp.png" alt="turntable"></div>  
     <div classname="sidebarMouse"><object type="application/x-shockwave-flash" style="outline:none;" data="https://files.cnblogs.com/files/jingmoxukong/mouse.swf?up_bodyColor=f0e9cc&amp;up_feetColor=D4C898&amp;up_eyeColor=000567&amp;up_wheelSpokeColor=DEDEDE&amp;up_wheelColor=FFFFFF&amp;up_waterColor=E0EFFF&amp;up_earColor=b0c4de&amp;up_wheelOuterColor=FF4D4D&amp;up_snoutColor=F7F4E9&amp;up_bgColor=F0E4E4&amp;up_foodColor=cba920&amp;up_wheelCenterColor=E4EB2F&amp;up_tailColor=E6DEBE&amp;" width="240" height="160"><param name="movie" value="https://files.cnblogs.com/files/jingmoxukong/mouse.swf?up_bodyColor=f0e9cc&amp;up_feetColor=D4C898&amp;up_eyeColor=000567&amp;up_wheelSpokeColor=DEDEDE&amp;up_wheelColor=FFFFFF&amp;up_waterColor=E0EFFF&amp;up_earColor=b0c4de&amp;up_wheelOuterColor=FF4D4D&amp;up_snoutColor=F7F4E9&amp;up_bgColor=F0E4E4&amp;up_foodColor=cba920&amp;up_wheelCenterColor=E4EB2E&amp;up_tailColor=E6DEBE&amp;"><param name="AllowScriptAccess" value="always"><param name="wmode" value="opaque"></object></div>
     <!-- 这里是js部分 -->
     <script>
         var oPointer = document.getElementsByTagName("img")[0];
         var oTurntable = document.getElementsByTagName("img")[1];
         var cat = 45; //总共8个扇形区域，每个区域约45度
         var offOn = true; //是否正在抽奖,
	 var rdm=0;//随机度数
         oPointer.onclick = function () {
            if (offOn) {
                 oTurntable.style.transform = "rotate(0deg)";
                 offOn = !offOn;
                 ratating();
             }
         }
         //旋转
         function ratating() {
             var timer = null;
		console.log(rdm);
		rrdm=rdm;
		rdm = 0; //随机度数置0
             clearInterval(timer);
		rdm = Math.floor((Math.random()*8+3) * 1000);
		console.log(rdm);
             timer = setInterval(function () {
                 if (Math.floor(rdm / 300) < 10 || Math.abs(rdm - rrdm)<=2000) { rdm = Math.floor((Math.random()*10+1))

*1000;console.log(rdm); }//要求rdm值大于3000度，且每次旋转值不小于100deg
                 else {
                     oTurntable.style.transform = "rotate(" + rdm + "deg)";
		     console.log(rdm);
                     clearInterval(timer);
                     setTimeout(function () {
                         offOn = !offOn;
                     }, 20000);
                 }
             }, 30);
         }
     </script>
     <!-- 爱心特效-->
     <script>
!function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e<d.length;e++)d[e].alpha<=0?(t.body.removeChild(d[e].el),d.splice(e,1)):(d[e].y--,d[e].scale+=.004,d[e].alpha-=.013,d[e].el.style.cssText="left:"+d[e].x+"px;top:"+d[e].y+"px;opacity:"+d[e].alpha+";transform:scale("+d[e].scale+","+d[e].scale+") rotate(45deg);background:"+d[e].color+";z-index:99999");requestAnimationFrame(r)}function o(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),i(e)}}function i(e){var a=t.createElement("div");a.className="heart",d.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:s()}),t.body.appendChild(a)}function c(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}function s(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var d=[];e.requestAnimationFrame=function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)}}(),n()}(window,document);</script>
<!--小老鼠特效-->
 </body>
 </html>